package com.mesnac.sort.heap;

public interface Heap<T>  
{  
    /** 
     * return the top element of the heap 
     *  
     * @return top element 
     */  
    Object get();  
  
    /** 
     * remove the top element of the heap and return it the heap must be fixed. 
     *  
     * @return top element 
     */  
    Object remove();  
  
    /** 
     * reset the top element 
     *  
     * @param obj 
     *            the new top element 
     */  
    void set(T obj);  
  
    /** 
     * add a element to the heap. if no comparator is set, the obj must be 
     * implments comparable interface 
     *  
     * @param obj 
     *            the element to be added 
     */  
    void add(T obj);  
  
    /** 
     * if the heap is empty return true; 
     *  
     * @return true if heap is empty,else false 
     */  
    boolean isEmpty();  
  
    /** 
     * clear the heap 
     */  
    void clear();  
}  
